import java.util.LinkedHashMap;
import java.util.Set;

/**
 * @ClassName LinkedHashMapDemo
 * @Description LinkedHashMap
 * @Author Li
 * @Date 2022/8/6 9:07
 * @ModifyDate 2022/8/6 9:07
 * @Version 1.0
 */
public class LinkedHashMapDemo {
    public static void main(String[] args) {
        // 创建Map对象
        LinkedHashMap<String, String> map = new LinkedHashMap<>();

        // public V put(K key, V value)：把指定的键与指定的值添加到Map集合中
        map.put("14122471","张三");
        map.put("14122472","李四");
        map.put("14122473","王二");
        map.put("14122474","麻子");
        map.put("14122471","赵五");

        // 遍历键，获取value
        Set<String> keys = map.keySet();
        for (String key : keys) {
            String value = map.get(key);
            System.out.println(key + "=" + value);
        }
    }
}
